package com.example.dllo.keepdemo.greendao;

import android.database.sqlite.SQLiteDatabase;

import java.util.Map;

import de.greenrobot.dao.AbstractDao;
import de.greenrobot.dao.AbstractDaoSession;
import de.greenrobot.dao.identityscope.IdentityScopeType;
import de.greenrobot.dao.internal.DaoConfig;

import com.example.dllo.keepdemo.greendao.TraniPlan;
import com.example.dllo.keepdemo.greendao.TrainWorkouts;
import com.example.dllo.keepdemo.greendao.DynamicFind;
import com.example.dllo.keepdemo.greendao.DynamicAttention;
import com.example.dllo.keepdemo.greendao.DynamicLatest;

import com.example.dllo.keepdemo.greendao.TraniPlanDao;
import com.example.dllo.keepdemo.greendao.TrainWorkoutsDao;
import com.example.dllo.keepdemo.greendao.DynamicFindDao;
import com.example.dllo.keepdemo.greendao.DynamicAttentionDao;
import com.example.dllo.keepdemo.greendao.DynamicLatestDao;

// THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT.

/**
 * {@inheritDoc}
 * 
 * @see de.greenrobot.dao.AbstractDaoSession
 */
public class DaoSession extends AbstractDaoSession {

    private final DaoConfig traniPlanDaoConfig;
    private final DaoConfig trainWorkoutsDaoConfig;
    private final DaoConfig dynamicFindDaoConfig;
    private final DaoConfig dynamicAttentionDaoConfig;
    private final DaoConfig dynamicLatestDaoConfig;

    private final TraniPlanDao traniPlanDao;
    private final TrainWorkoutsDao trainWorkoutsDao;
    private final DynamicFindDao dynamicFindDao;
    private final DynamicAttentionDao dynamicAttentionDao;
    private final DynamicLatestDao dynamicLatestDao;

    public DaoSession(SQLiteDatabase db, IdentityScopeType type, Map<Class<? extends AbstractDao<?, ?>>, DaoConfig>
            daoConfigMap) {
        super(db);

        traniPlanDaoConfig = daoConfigMap.get(TraniPlanDao.class).clone();
        traniPlanDaoConfig.initIdentityScope(type);

        trainWorkoutsDaoConfig = daoConfigMap.get(TrainWorkoutsDao.class).clone();
        trainWorkoutsDaoConfig.initIdentityScope(type);

        dynamicFindDaoConfig = daoConfigMap.get(DynamicFindDao.class).clone();
        dynamicFindDaoConfig.initIdentityScope(type);

        dynamicAttentionDaoConfig = daoConfigMap.get(DynamicAttentionDao.class).clone();
        dynamicAttentionDaoConfig.initIdentityScope(type);

        dynamicLatestDaoConfig = daoConfigMap.get(DynamicLatestDao.class).clone();
        dynamicLatestDaoConfig.initIdentityScope(type);

        traniPlanDao = new TraniPlanDao(traniPlanDaoConfig, this);
        trainWorkoutsDao = new TrainWorkoutsDao(trainWorkoutsDaoConfig, this);
        dynamicFindDao = new DynamicFindDao(dynamicFindDaoConfig, this);
        dynamicAttentionDao = new DynamicAttentionDao(dynamicAttentionDaoConfig, this);
        dynamicLatestDao = new DynamicLatestDao(dynamicLatestDaoConfig, this);

        registerDao(TraniPlan.class, traniPlanDao);
        registerDao(TrainWorkouts.class, trainWorkoutsDao);
        registerDao(DynamicFind.class, dynamicFindDao);
        registerDao(DynamicAttention.class, dynamicAttentionDao);
        registerDao(DynamicLatest.class, dynamicLatestDao);
    }
    
    public void clear() {
        traniPlanDaoConfig.getIdentityScope().clear();
        trainWorkoutsDaoConfig.getIdentityScope().clear();
        dynamicFindDaoConfig.getIdentityScope().clear();
        dynamicAttentionDaoConfig.getIdentityScope().clear();
        dynamicLatestDaoConfig.getIdentityScope().clear();
    }

    public TraniPlanDao getTraniPlanDao() {
        return traniPlanDao;
    }

    public TrainWorkoutsDao getTrainWorkoutsDao() {
        return trainWorkoutsDao;
    }

    public DynamicFindDao getDynamicFindDao() {
        return dynamicFindDao;
    }

    public DynamicAttentionDao getDynamicAttentionDao() {
        return dynamicAttentionDao;
    }

    public DynamicLatestDao getDynamicLatestDao() {
        return dynamicLatestDao;
    }

}
